@extends('layouts.master')
@section('head')
	@parent
	<title>FACT - Alumni</title>

	<script type="text/javascript">
		function printDiv(divId){
			var restorepage = document.body.innerHTML;
			var printcontent = document.getElementById(divId).innerHTML;
			document.body.innerHTML = printcontent;
			window.print();
			document.body.innerHTML = restorepage;
		}
	</script>
@stop

@section('content')	
	<div class="main">
      <div class="shop_top">
		<div class="container">
			<div class="row">
				<div id="divPrint" class="col-md-9 single_left">
				   <div class="single_image">
					     <ul class="ul-style">
							<li>
								<img class="img-responsive photo-border" src="/images/{{$alum->image}}" />
							</li>
						</ul>
				    </div>
			        <div class="single_right ">
			        	<h2>{{$alum->first_name}} {{$alum->mi}} {{$alum->last_name}}</h2>
			        	<p class="m_10">BATCH {{$alum->batch}}</p>
			        	<hr>
							<h3>Age</h3>
							<p class="m_10">{{$alum->age}}</p>
							<h3>Email</h3>
							<p class="m_10">{{$alum->email}}</p>
							<h3>Contact No.</h3>
							<p class="m_10">{{$alum->contact_no}}</p>

			        </div>
			        <div class="clear"> </div>
				</div>
				<div class="col-md-3">					
					<div class="col-md-1 print-m">
						<button class="btn btn-primary" onclick="printDiv('divPrint')"><a style="color:white;">Print Profile</a></button>
					</div>
					@if(Auth::user()->first_name == 'Admin')
						{!! Form::open(array('method'=>'delete', 'route'=>['alumni.destroy', $alum->id])) !!}
							<div class="col-md-1" style="margin-left: 13px;">
								<button class="btn btn-primary btn-marg"><a style="color:white;">Delete Profile</a></button>
							</div>
						{!! Form::close() !!}	
					@endif
					@if(Auth::user()->first_name == 'Admin' && $alum->status == '0')
						<form class="form-horizontal" role="form" method="POST" action="/alumni/{{$alum->id}}" enctype="multipart/form-data">
							<input type="hidden" name="_token" value="{{ csrf_token() }}">
							<input type="hidden" name="_method" value="PUT" />
							<div class="col-md-1" style="margin-top: 40px; margin-left: -12px;">
								<button type="submit" class="btn btn-primary btn-marg"><a style="color:white;">Activate</a></button>
							</div>
						</form>
					@endif
					<div class="box-logo">
						<img class="SEC-logo" src="/images/SchoolLogo1.jpg">
					</div>
			   </div>			   
			</div>

			<hr>
			<div class="comments">
				<h3 class="m_6 padding-left">COMMENTS</h3>
				<ol class="comments-list">
					@foreach($comm as $com)
						<li>
							<p><a href="#"><img src="/images/{{$com->author->image}}" alt="" class="avatar" /></a></p>
	    					<p class="c_2">Posted {{$com->created_at}} <span>by {{$com->author->first_name}}</span></p>
	   						<p class="c_1">{{$com->description}}</p>
						</li>
					@endforeach
				</ol>
			</div>
			<div class="row">
				<div class="col-md-12 contact">
					<hr>
					<h3>POST</h3>
				 	<form role="form" method="POST" action="/alumni/{{$id}}" enctype="multipart/form-data">
						<input type="hidden" name="_token" value="{{ csrf_token() }}">				 		
						<input type="hidden" name="author_id" value="{{Auth::user()->id}}">					
						<div class="text">
		                   <textarea type="text" value="" name="description" onfocus="this.value = '';" onblur="if (this.value == '') {this.value = 'Message';}">Message:</textarea>
		                   <div class="form-submit">
				           <input name="submit" type="submit" id="submit" value="Post"><br>
				           </div>
		                </div>
		                <div class="clear"></div>
                   </form>
			    </div>
			</div>	
	     </div>
	   </div>
	  </div>
@stop